home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / a / amitcpprosdkv4.3+key.lha / AmiTCP-43_Install / Install_AmiTCP < prev    next >
Encoding:
Text File  |  1996-08-10  |  43.4 KB  |  1,357 lines

  1. ;;;; Hey Emacs, this script might as well be -*- lisp -*-
  2. ;;;;
  3. ;;;; Install_AmiTCP - AmiTCP/IP installation script for Installer
  4. ;;;;
  5. ;;;; Copyright © 1996 AmiTCP/IP Group,
  6. ;;;;                  NSDi - Network Solutions Development Inc., Finland
  7. ;;;;                  All rights reserved.
  8. ;;;;
  9. ;;;; $Id: Install_AmiTCP,v 4.25 1996/03/29 05:31:28 ppessi Exp $
  10. ;;;;
  11. ;;;; This script has been tested with Installer 1.24:
  12. ;;;;
  13. ;;;;     Installer and Installer project icon
  14. ;;;;     (c) Copyright 1991-93 Commodore-Amiga, Inc.  All Rights Reserved.
  15. ;;;;     Reproduced and distributed under license from Commodore.
  16. ;;;;
  17. ;;;;     INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
  18. ;;;;     NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
  19. ;;;;     OR RESPONSIBILITY IS ASSUMED.
  20. ;;;;
  21. ;;;; Use following Icon tooltypes / Command line options:
  22. ;;;; APPNAME=AmiTCP/IP
  23. ;;;; MINUSER=AVERAGE
  24. ;;;;
  25. (welcome "    Welcome to the " @app-name " 4.3 installation.\n")
  26. ;;;;
  27. ;;;; What we are?
  28. ;;;;
  29. (set app-name (cat @app-name " 4.3"))
  30. (set app-dir-name (cat "AmiTCP" "-43"))
  31. ;;;;
  32. ;;;; "Needs"
  33. ;;;;
  34. (set need-version 37  ; version of operating system need by AmiTCP/IP
  35.      need-memory (* 512 1024)
  36.  
  37.      AmiTCP-release-number 4 ; this release
  38.      )
  39. (set 
  40. ;;;
  41. ;;; Installation disk names
  42. ;;;
  43.  install-disk1-name "AmiTCP-43_Install1:"
  44.  install-disk2-name "AmiTCP-43_Install2:"
  45. ;;;
  46. ;;; Used pkt-files, source-dir will remain on the disk from which the 
  47. ;;; installer was started!
  48. ;;;
  49.  AmiTCP-pkt-file (tackon install-disk1-name "AmiTCP.lzx")
  50.  GNUEmacs-pkt-file (tackon install-disk2-name "GNUEmacs.lzx")
  51.  NapsaFonts-pkt-file (tackon install-disk2-name "NapsaFonts.lzx")
  52.  SDK-pkt-file (tackon install-disk2-name "AmiTCP-SDK-4.3.lzx")
  53. ;;;
  54. ;;; Other sources on installation disks
  55. ;;;
  56.  dist-networks-dir (tackon install-disk2-name "Devs/Networks")
  57.  Installer-file (tackon install-disk1-name "bin/Installer")
  58.  UnPkt-file (tackon install-disk2-name "UnLZX")
  59.  LICENSE-file (tackon install-disk1-name "LICENSE")
  60.  GNUEmacs-readme-file (tackon install-disk2-name "GNUEmacs.readme")
  61.  SDK-readme-file (tackon install-disk2-name "AmiTCP_SDK-ReadMe")
  62.  
  63. ;;;
  64. ;;; Destination directories of the AmiTCP/IP
  65. ;;;
  66.  atcp-name "AmiTCP"
  67.  atcp-assign (cat atcp-name ":")        ; Assign to AmiTCP
  68.  ;; Configuration
  69.  conf-dir (tackon atcp-assign "db")
  70.  ;; User binaries
  71.  bin-dir (tackon atcp-assign "bin")
  72.  ;; documentation
  73.  doc-dir (tackon atcp-assign "doc")
  74.  ;; devices directory
  75.  devs-dir (tackon atcp-assign "devs")
  76.  ;; AmigaGuide documentation
  77.  help-dir (tackon atcp-assign "help")
  78.  ;; DOS handlers
  79.  l-dir (tackon atcp-assign "l")
  80.  ;; libraries
  81.  libs-dir (tackon atcp-assign "libs")
  82.  ;; daemons
  83.  serv-dir (tackon atcp-assign "serv")
  84.  ;; source
  85.  src-dir (tackon atcp-assign "src")
  86.  ;; includes for net applications
  87.  include-dir (tackon atcp-assign "netinclude")
  88.  ;; network link libraries
  89.  lib-dir (tackon atcp-assign "netlib")
  90.  ;;
  91.  ;; The source directory name
  92.  source-dir (if (= 1 (exists @icon))
  93.             (pathonly (expandpath @icon))
  94.           (expandpath @icon))
  95.  ;; Mounts
  96.  apipe-mount (cat 
  97.           "Assign APIPE: Exists > NIL:\n" 
  98.           "IF Warn\n"
  99.           "  Mount APIPE: from AmiTCP:devs/APipe-Mountlist\n"
  100.           "EndIf\n")
  101.  )
  102.  ;; How to get needed information?
  103. (set
  104.  net-setup-help
  105.      "    You can get this information from your network administration.\n")
  106.  
  107. ;;; copy "more" to ram: to be able to use it
  108. (set
  109. ; pager-cmd (if (exists "ENV:PAGER" (noreq)) (getenv "PAGER"))
  110.  pager-cmd 
  111. ; (if pager-cmd pager-cmd 
  112.  (if (exists "SYS:Utilities/More" (noreq))
  113.      ((copyfiles
  114.        (prompt "Copying sys:utilities/more to ram: for use")
  115.        (source "SYS:Utilities/More")
  116.        (dest   "RAM:")
  117.        (safe)
  118.        (optional "nofail"))
  119.       "RAM:More")
  120.    ("more"))
  121. ; )
  122.  )
  123.  
  124. ;; Return old AmiTCP: assign if we are aborting
  125. (onerror
  126.  (if old-atcp-directory
  127.      (makeassign atcp-name old-atcp-directory)))
  128.  
  129. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  130. (procedure
  131.  check-system-version
  132.  ;; is your Exec recent enough?
  133.  (set exec-version (/ (getversion) 65536))
  134.  (transcript "Running on exec version " exec-version ".")
  135.  (if (< exec-version need-version)      ; check operating system version
  136.      ((message "The " @app-name " needs at least Exec version " need-version
  137.            " to run.\n"
  138.            "You have only version " exec-version ".\n"
  139.            "You can proceed with the installation, but consider "
  140.            "installing the " @app-name " with proper version of "
  141.            "the operating system."
  142.            (help
  143.         "    The " @app-name " uses some system functions "
  144.         "that are not present or functional in earlier system "
  145.         "versions. Consider updating your system.\n"
  146.         "    If you have a later version of operating system "
  147.         "and are only now using older version: be sure to use "
  148.         "only release 2.04 or newer with the " @app-name ". "
  149.         "No damage happens if you run the " @app-name " with an "
  150.         "earlier operating system, however. It just "
  151.         "refuses to start.\n"
  152.         "    If you decide to continue, no changes will be made to "
  153.         "system startup files, so you must edit them yourself. "
  154.         "Refer instructions for manual installation."))
  155.       (transcript "User decided to continue installation while running "
  156.           "on operating system release earlier than 2.04."))))
  157.  
  158.  
  159. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  160. (procedure
  161.  check-available-memory
  162.  ;;
  163.  (transcript "Checking available memory.")
  164.  (set avail-mem (+ (database "total-mem")))
  165.  (if (< avail-mem need-memory)
  166.      ((message "Your system has only " (/ avail-mem 1024) " kilobytes of "
  167.            "free memory, while the " @app-name " needs at least "
  168.            (/ need-memory 1024) " to be useful.\n"
  169.            "You can continue the installation but be warned!")
  170.       (transcript "User decided to continue installation while available "
  171.           "memory was below the recommended minimum."))))
  172.  
  173. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  174. (procedure
  175.  check-user-level
  176.  ;;
  177.  (transcript "Checking user level.")
  178.  (if (< @user-level 1)
  179.      ((transcript "Installation aborted due to too low user level.")
  180.       (abort "AmiTCP/IP installation requires at least the \"average\" "
  181.          "user level. Restart installation and select appropriate user "
  182.          "level."))))
  183.  
  184. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  185. (procedure
  186.  check-old-assign
  187.  ;; If there is already the AmiTCP/IP installed, store the assign
  188.  ;; to old-atcp-directory
  189.  (transcript "Checking for already installed AmiTCP.")
  190.  (set old-atcp-directory 
  191.       (if (exists atcp-assign (noreq))
  192.       (getassign atcp-name)
  193.     ""))
  194.  (if old-atcp-directory
  195.      (transcript "Existing AmiTCP detected at directory " 
  196.          old-atcp-directory ".")))
  197.  
  198. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  199.  
  200. ; Simple database "emulator" for testing purposes 
  201. (procedure
  202.  database-test "68000")
  203.  
  204. (procedure
  205.  check-cpu-type
  206.  (set cpu-type (database "cpu"))
  207. ; (set cpu-type (database-test))
  208.  (set cpu-is-020-or-better
  209.       (AND (<> cpu-type "68000")
  210.        (<> cpu-type "68010")))
  211.  )
  212. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  213. (procedure
  214.  ask-accept-license ;; Ask if the user accepts license conditions
  215.  (transcript "Asking if the user accepts the license conditions.")
  216. ;;
  217. ;; use "more" to show the full license text
  218. ;;
  219.  (run (cat "run " pager-cmd) LICENSE-file (safe))
  220.  (message "\nAmiTCP/IP is a copyrighted propiertary software of "
  221.       "the Network Solutions Development Inc.\n"
  222.       "\nPlease read the shown license text carefully.\n"
  223.       "\nBy proceeding the installation of this software you "
  224.       "indicate that you accept the license conditions.\n\n"
  225.       "Also note that you should fill in your registration card "
  226.       "and send the filled card to NSDi using the included "
  227.       "return-envelope.  The return-envelope is pre-paid "
  228.       "worldwide, no extra stamps are needed.\n"
  229.       )
  230.  )
  231.  
  232. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  233. (procedure
  234.  select-destination-directory
  235.  ;; Select destination directory for the installation.
  236.  ;; This is the floppy install-version
  237.  ;;
  238.  (transcript "Selecting destination directory for the installation.")
  239.  (set @default-dest
  240.       (askdir
  241.        (prompt "Select directory where to install the " app-name ".")
  242.        (help "    Here you can specify location where to install "
  243.          "the " app-name ".\n"
  244.          "    Installation must NOT be made on top of an older "
  245.          "version of the " @app-name ".\n"
  246.          "  Installer will create a subdirectory called `"
  247.          app-name "' to the selected directory and copy the " 
  248.          @app-name " files to it.")
  249.        (newpath)
  250.        (default 
  251.      (if (= 2 (exists "Work:" (noreq)))
  252.          "Work:" 
  253.        (cat (getdevice "SYS:") ":")))
  254.        ))
  255.  (set dest-temp (tackon @default-dest app-dir-name))
  256.  (set @default-dest dest-temp)
  257.  (makedir dest-temp (safe) (infos))
  258.  (message app-name " will be installed in " dest-temp)
  259.  
  260.  ;; Make the AmiTCP: assign
  261.  (makeassign atcp-name @default-dest)
  262.  (if (NOT (= 2 (exists (tackon atcp-assign "devs"))))
  263.      (makedir (tackon atcp-assign "devs")))
  264. )
  265.  
  266. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  267. ;;
  268. ;; This is floppy-install version
  269. ;;
  270. ;; arguments:
  271. ;;
  272. ;;   unpkt-source      - the source archive
  273. ;;   unpkt-destination - the destination directory
  274. ;;   unpkt-sdp         - number of directories to strip
  275. ;;   unpkt-title-name  - descriptative name of the archive
  276. ;;   unpkt-title-not   - installation unit name
  277.  
  278. (procedure
  279.  run-unpkt 
  280.  ;;
  281.  (if (exists unpkt-source)
  282.      ((transcript "Dearchiving " unpkt-source " files to " unpkt-destination ".")
  283.       (working "Writing files to " unpkt-destination "...")
  284.       (if (run (cat unpkt-cmd " "
  285.             "\"" unpkt-source "\" "
  286.             "\"" unpkt-destination "\" "))
  287.       (abort "    UnLZX could not dearchive the " unpkt-source ". "
  288.          "This may be due to:\n"
  289.          "    1) Not enough disk space\n"
  290.          "    2) Not enough memory\n"
  291.          "    3) Corrupted archive\n"
  292.          "    4) Corrupted UnLZX\n"))
  293.       1)
  294.    ((transcript unpkt-source " could not be located, and is NOT installed!")
  295.     (message "\nWARNING\n\n"
  296.          "Could not locate the " unpkt-title-name " archive.\n"
  297.          unpkt-title-not " is NOT installed!")
  298.     0))
  299.  )
  300.  
  301.  
  302. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  303. ;;
  304. ;; This is floppy-install version
  305. ;;
  306. (procedure
  307.  copy-files-to-destination ;;; UnPkt AmiTCP/IP files to the destination
  308.  ;;
  309.  
  310.  (set 
  311.   unpkt-source AmiTCP-pkt-file
  312.   unpkt-destination (cat @default-dest "//")
  313.   unpkt-title-name "AmiTCP/IP program"
  314.   unpkt-title-not "AmiTCP/IP"
  315.   )
  316.  (if (run-unpkt)
  317.      (
  318.       ;;
  319.       ;; Copy the Installer
  320.       ;;
  321.       (copyfiles
  322.        (source Installer-file)
  323.        (dest bin-dir)
  324.        (files)
  325.        (infos))
  326.  
  327.       ;;
  328.       ;; Create AmiTCP:log if it does not exist already
  329.       ;;
  330.       (if (NOT (= 2 (exists (tackon atcp-assign "log"))))
  331.       (makedir (tackon atcp-assign "log")))
  332.       ;;
  333.       ;; Create AmiTCP:log/wtmp if it does not exist already
  334.       ;; (This is to avoid unnecessary errors from the ftpd)
  335.       ;;
  336.       (if (NOT (= 1 (exists (tackon atcp-assign "log/wtmp"))))
  337.       (textfile (dest (tackon atcp-assign "log/wtmp"))))
  338.       ;;
  339.       ;; Add script flags to the scripts, pure flags to pure programs
  340.       ;;
  341. ; (protect (tackon bin-dir "ch_nfsctl") "+s +e")
  342. ; (protect (tackon bin-dir "netstat") "+s +e")
  343. ; (protect (tackon bin-dir "SynClock") "+s +e")
  344. ; (protect (tackon bin-dir "stopnet") "+s +e")
  345. ; (if (exists src-dir)
  346. ;     ((protect (tackon src-dir "compile") "+s +e")
  347. ;      (protect (tackon src-dir "compile.lib") "+s +e")))
  348. ; (protect (tackon bin-dir "NapsaTerm") "+p +e")
  349. ; (protect (tackon serv-dir "in.fingerd") "+p +e")
  350. ; (if (exists (tackon bin-dir "rcsrev"))
  351. ;     (protect (tackon bin-dir "rcsrev") "+p +e"))
  352.  
  353.       (ask-use-020-binaries)
  354.  
  355.       ;; Install the docs...
  356.       (if 1
  357.       (if (or (or (>= exec-version 39)
  358.               (exists "SYS:Utilities/multiview"))
  359.           (> @user-level 1))
  360.           (if (askbool
  361.            (prompt
  362.             "AmigaGuide utility is used to view the included "
  363.             "AmigaGuide documents in \"AmiTCP:help/\" directory.\n\n"
  364.             "Would you like to use MultiView instead?")
  365.            (help
  366.             "Installer has detected that your operating system should "
  367.             "include the MultiView utility, which you might want to "
  368.             "use instead of AmigaGuide utility to show the online "
  369.             "documentation."))
  370.           ((set multiview-path
  371.             (if (exists "SYS:Utilities/multiview")
  372.                 "SYS:Utilities/multiview"
  373.               (askfile
  374.                (prompt "Please show where the MultiView utility "
  375.                    "can be found:")
  376.                (help "The MultiView utility could not be located "
  377.                  "from it's normal location "
  378.                  "(\"SYS:Utilities/multiview\"), so you need "
  379.                  "to tell the location of the utility. Give "
  380.                  "an empty name to cancel the operation.\n")
  381.                (default "SYS:Utilities/")
  382.                ))
  383.             )
  384.            (if (= 1 (exists multiview-path))
  385.                (foreach 
  386.             help-dir "#?.info"
  387.             (tooltype
  388.              (dest
  389.               (tackon
  390.                help-dir 
  391.                (substr
  392.                 @each-name 0 (- (strlen @each-name) 5))))
  393.                 
  394.              (setdefaulttool multiview-path)))))
  395.         )))
  396.       ;; AmiTCP/IP program archive installed succesfully
  397.       1)
  398.     0))
  399.  
  400. (procedure
  401.  ask-use-020-binaries
  402.  (if cpu-is-020-or-better
  403.      (if (askbool
  404.       (prompt "Your CPU is of type " cpu-type ", thus the '020 "
  405.           "version of AmiTCP (AmiTCP.020) should be renamed to "
  406.           "\"AmiTCP\" (The '000 binary will be kept as "
  407.           "\"AmiTCP.000\").\n\nShall this be done?\n")
  408.       (help "You have an option to determine which AmiTCP binary "
  409.         "version should be used. The selection is left to you "
  410.         "for you to be able to switch to either of the binaries "
  411.         "if there happens to be problems with the other.")
  412.       )
  413.      ;; rename AmiTCP to AmiTCP.000 and AmiTCP.020 to AmiTCP
  414.      ((rename (tackon atcp-assign "AmiTCP")
  415.           (tackon atcp-assign "AmiTCP.000"))
  416.       (rename (tackon atcp-assign "AmiTCP.020")
  417.           (tackon atcp-assign "AmiTCP"))
  418.       )
  419.        )
  420.    ;; Delete the '020 binaries, if not '020 or higher
  421.    (if (askbool
  422.     (choices "Delete" "Do not delete")
  423.     (prompt "Your CPU is of type " cpu-type ", thus the '020 "
  424.         "version of AmiTCP could be deleted from your disk. "
  425.         "If you later upgrade your CPU, you should "
  426.         "re-install " @app-name ".\n")
  427.     (help "The '020 binary can be deleted to save your disk space."))
  428.        (delete (tackon atcp-assign "AmiTCP.020")
  429.            (optional "force")))
  430.    ))
  431.  
  432. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  433. (procedure
  434.  update-devices
  435.  (transcript "Updating Sana-II device drivers.")
  436.  ;;
  437.  ;; Create directory DEVS:Networks if it does not exist already
  438.  ;;
  439.  (if (NOT (= 2 (exists "DEVS:Networks")))
  440.      (makedir "DEVS:Networks"))
  441.  ;;
  442.  ;; Copy each driver in the distribution to the DEVS:Networks if necessary
  443.  ;;
  444.  (working "Checking Sana-II device drivers...")
  445.  (if (= 2 (exists dist-networks-dir))
  446.      (foreach
  447.        dist-networks-dir "#?.device"
  448.        ((set dist-name (tackon dist-networks-dir @each-name)
  449.          devs-name (tackon "DEVS:Networks" @each-name)
  450.          dist-version (getversion dist-name)
  451.          copy-it (NOT (exists devs-name)))
  452.     ;;
  453.     ;; Check if the driver should be copied over
  454.     ;;
  455.     (if (NOT copy-it)
  456.         (set copy-it
  457.              ; or if the driver in DEVS:Networks is of older version
  458.          (< (set devs-version (getversion devs-name)) dist-version)))
  459.     (if (NOT copy-it)
  460.         (set copy-it
  461.              ; or if the files are of the same version but different
  462.          (set sum-differs (if (= dist-version devs-version)
  463.                       (<> (getsum dist-name)
  464.                       (getsum devs-name))
  465.                     0))))
  466.     (if copy-it
  467.         (copyfiles
  468.          (prompt "Should this Sana-II driver be installed in Devs:Networks?\n"
  469.              (if devs-version
  470.              (cat "A driver with the same name exists already"
  471.                   (if sum-differs
  472.                   (cat ", it has the same version, but the "
  473.                        "files are not the same.")
  474.                 (cat ", but the driver in the "
  475.                      "DEVS:Networks is of older version.")))
  476.                ""))
  477.          (help
  478.           "    The Sana-II drivers should be located in "
  479.           "the DEVS:Networks directory.\n"
  480.           "    This directory is the official location for the Sana-II "
  481.           "device drivers.")
  482.          (source (pathonly dist-name))
  483.          (choices (fileonly dist-name))
  484.          (dest "DEVS:Networks")
  485.          (files)
  486.          (optional "nofail" "askuser")
  487.          (confirm "average")))))
  488.    (message "No Sana-II drivers found on the installation disk")
  489.    )
  490.  )
  491.  
  492. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  493. (procedure
  494.  ask-update-devices
  495.  (if (= 2 (exists dist-networks-dir))
  496.      (if (askbool
  497.       (prompt "\nDo you want to update your Sana-II network device "
  498.           "drivers?\n"
  499.           "Each copy will be confirmed.")
  500.           (help
  501.            "    Each new AmiTCP/IP distribution usually contains "
  502.            "updated versions of some of the provided Sana-II network "
  503.            "device drivers. If you choose \"Yes\", this installation "
  504.            "script will check for each device, if this is the case."))
  505.          (update-devices)
  506.        (transcript "User did not want to update Sana-II drivers."))
  507.    (transcript "Directory " dist-networks-dir " not found.")))
  508.  
  509. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  510. ;; 
  511. ;; arguments:
  512. ;;
  513. ;; uus::commands - commands to add
  514. ;; uus::section  - section name
  515. ;; uus::file     - file name into which to save the changes if needed
  516. ;;
  517. (procedure
  518.  update-user-startup
  519.  (set uus::complete (cat ";BEGIN " uus::section "\n"
  520.              uus::commands
  521.              ";END " uus::section "\n"))
  522.  (if (askbool
  523.       (prompt "\nDo you want Installer to make the required changes to "
  524.           "your S:User-Startup script?\n"
  525.           "\n(There is a problem with Installer making these "
  526.           "changes if you do not have the original boot volume "
  527.           "mounted. Installer may crash or corrupt your system "
  528.           "in that case.)")
  529.       (help "If you do not want Installer make the changes, it will "
  530.         "create a script file containing commands which you should "
  531.         "add to the S:User-Startup file."))
  532.      ;; Do the addition
  533.      ((set startup-changed 1)
  534.       (startup
  535.        uus::section
  536.        (command uus::commands)
  537.        (prompt "Installer will modify your S:User-Startup file. "
  538.            "Following lines will be appended to it:\n\n"
  539.            uus::complete)
  540.        (help "   Installer needs to make indicated modifications to "
  541.          "your user startup file.\n"
  542.          "   You should make modifications later by hand "
  543.          "if you skip this part.")))
  544.    ;; Let user add commands
  545.    ((textfile (dest uus::file)
  546.           (append uus::complete))
  547.     (message "Installer created file " uus::file
  548.          ", which you should add to your startup file by hand. "
  549.          "The file includes following changes:\n\n"
  550.          uus::complete))))
  551.  
  552. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  553. (procedure
  554.  ask-copy-old-configuration
  555.  ;;
  556.  ;; Copy old configuration files
  557.  ;; Returns TRUE if AmiTCP does not need to be configured.
  558.  ;; The reconfiguration is forced if old AmiTCP version is not 4 or higher,
  559.  ;; since the bin/startnet must be modified.
  560.  ;;
  561.  (set
  562.   edit-change-fingerd "t:edit-change-fingerd"
  563.   old-conf-dir (tackon old-atcp-directory "db")
  564.   old-resolv.conf (tackon old-conf-dir "resolv.conf")
  565.   old-startnet (tackon old-atcp-directory "bin/startnet")
  566.   old-motd (tackon old-conf-dir "motd"))
  567.  ;;
  568.  ;; return version of the old AmiTCP detected
  569.  ;;
  570.  (procedure 
  571.   get-old-atcp-version
  572.   (if (exists (tackon old-atcp-directory "AmiTCP") (noreq))
  573.       (/ (getversion (tackon old-atcp-directory "AmiTCP")) 65536)
  574.     0))
  575.  ;;
  576.  (set old-atcp-version (get-old-atcp-version))
  577.  ;;
  578.  ;; following is called only if old version is high enough
  579.  ;;
  580.  (procedure 
  581.   copy-old-startnet 
  582.   (if (exists old-startnet)
  583.       (message "Your old \"startnet\" file cannot be used by the new "
  584.            @app-name " because the structure of it "
  585.            "has changed.  This means that you will need "
  586.            "to provide most of the configuration information after the "
  587.            "installation.")
  588. ;      ((if (>= @user-level 2)
  589. ;          (message "\nCopying file\n\n"
  590. ;                   old-startnet "   \n"
  591. ;                   "\nto directory \"" @default-dest "\"."))
  592. ;       (copyfiles
  593. ;       (source old-startnet)
  594. ;       (dest bin-dir)
  595. ;       (files))
  596. ;       1                               ; succeeded
  597. ;       )
  598.     )
  599.   0) ; need to configure
  600.  ;;
  601.  (procedure 
  602.   copy-rest-config
  603.   (copyfiles
  604.    (prompt
  605.     "Select configuration files you want to copy from old configuration")
  606.    (help
  607.     "    You may copy your old configuration files or use untouched files "
  608.     "came with the new distribution.")
  609.    (source old-conf-dir) 
  610.    (dest conf-dir)
  611.    (files)
  612.    (confirm)
  613.    (if (AND (exists (tackon old-conf-dir "networks"))
  614.         (AND (exists (tackon old-conf-dir "ftpdir"))
  615.          (exists (tackon old-conf-dir "ftpusers"))))
  616.        (choices                         ; release 4.0 or later
  617.     "AmiTCP.config"
  618.     "ch_nfstab"
  619.     "ftpdir"
  620.     "ftpusers"
  621.     "group"
  622.     "inet.access"
  623.     "inetd.conf"
  624. ;       "interfaces"
  625.     "hosts"
  626.     "networks"
  627.     "resolv.conf"
  628.     "services"
  629.     "protocols"
  630.     "passwd"
  631.     "rpc")
  632.      (if (exists (tackon old-conf-dir "inet.access"))
  633.      (choices                       ; release 3.0 beta 2 or later
  634.       "AmiTCP.config"
  635.       "ch_nfstab"
  636.       "group"
  637.       "inet.access"
  638.       "inetd.conf"
  639.       "hosts"
  640.       "services"
  641.       "protocols"
  642.       "passwd"
  643.       "rpc")
  644.        (if (exists (tackon old-conf-dir "interfaces"))
  645.        (choices                     ; release 3.0 beta 1 or later
  646.         "AmiTCP.config"
  647.         "group"
  648.         "inetd.conf"
  649.         "hosts"
  650.         "services"
  651.         "protocols"
  652.         "passwd"
  653.         "rpc")
  654.      (if (exists (tackon old-conf-dir "passwd"))
  655.          (choices                   ; release 2.2 or later
  656.           "AmiTCP.config"
  657.           "group"
  658.           "inetd.conf"
  659.           "hosts"
  660.           "services"
  661.           "protocols"
  662.           "passwd")
  663.        (choices                     ; an old release
  664.         "AmiTCP.config"
  665.         "inetd.conf"
  666.         "hosts"
  667.         "services"
  668.         "protocols")))))
  669.    (optional "nofail" "force" "askuser")))
  670.  ;;
  671.  (procedure 
  672.   copy-motd
  673.   (if (exists old-motd)
  674.       ((if (>= @user-level 2)
  675.        (message "\nCopying file\n\n"
  676.             old-motd "\n"
  677.             "(Message Of The Day)\n"
  678.             "\nto directory \"" conf-dir "\"."))
  679.        (copyfiles
  680.     (source old-motd)
  681.     (dest conf-dir)
  682.     (files)))))
  683.  ;;
  684.  ;; Following is currently not needed, since if old version is too old, we
  685.  ;; force user to reconfigure AmiTCP anyway
  686.  ;;
  687.  (procedure 
  688.   update-startnet
  689.   (set startnet-file (tackon bin-dir "startnet"))
  690.   (if (run (cat "search search \"Mount TCP:\" quiet from " startnet-file)
  691.        (safe))
  692.       ((textfile (dest startnet-file)
  693.          (include startnet-file)
  694.         (append tcp-mount "\n")
  695.         (prompt 
  696.          "\nDo you want to mount TCP: device at network startup?")
  697.         (help 
  698.          "    The " @app-name " includes a DOS handler for TCP "
  699.          "communications. This DOS handler will usually be mounted "
  700.          "at the network startup.")
  701.         (confirm))
  702.        (protect (tackon bin-dir "startnet") "+s +e"))))
  703.  (procedure
  704.   update-services
  705.   (set service-file (tackon conf-dir "services"))
  706.   (if (run (cat "search search \"amiganetfs\" quiet from " service-file)
  707.        (safe))
  708.       (;; Not found, add it 
  709.        (textfile (dest service-file)
  710.          (include service-file)
  711.          (append ";\n; Amiga specific services\n;\n"
  712.              "amiganetfs      2500/tcp\n")
  713.          (prompt 
  714.           "Do you want to add AmigaNetFS service to your "
  715.           "service database?")
  716.          (help 
  717.           "    The " @app-name " includes NetFS, network file system "
  718.           "between Amigas, by Timo Rossi. It is a TCP based protocol "
  719.           "which requires both ends of connection have same service "
  720.           "(TCP port) entries. If you already had NetFS installed "
  721.           "you probably do not want to update your service "
  722.           "database.")
  723.          (confirm)))))
  724.  (procedure
  725.   update-hosts
  726.   (set hosts-file (tackon conf-dir "hosts"))
  727.   (if (run (cat "search search \"localhost\" quiet from " hosts-file)
  728.        (safe))
  729.       (;; Not found, add it
  730.        (transcript "Adding 'localhost' entry to the db/hosts.")
  731.        (textfile (dest hosts-file)
  732.          (include hosts-file)
  733.          (append ";\n; Entry for the localhost\n;\n"
  734.              "127.0.0.1 localhost\n")
  735.          ))))
  736.  (procedure
  737.   update-inetd-conf
  738.   ;; Change fingerd to serv/in.fingerd
  739.   (set inetd-conf (tackon atcp-assign "db/inetd.conf"))
  740.   (if (run (cat "search search \"serv/in.fingerd\" quiet from " inetd-conf)
  741.        (safe))
  742.       ((textfile 
  743.     (dest edit-change-fingerd)
  744.     (append
  745.      "f b/finger    stream/\n"
  746.      "e -amitcp:bin/fingerd-amitcp:serv/in.fingerd-\n"
  747.      "m+"
  748.      "i"
  749.      "# NetFS, a networking support between Amigas"
  750.      "# Remove # from the next line to enable NetFS"
  751.      "#amiganetfs stream    tcp nowait root amitcp:serv/netfs-server"
  752.      "Z"
  753.      "w\n")
  754.     (safe))
  755.        (run (cat "c:edit from " inetd-conf " with "
  756.          edit-change-fingerd " >t:what-changed")
  757.         (confirm)
  758.         (prompt "\nUpdate \"inetd.conf\" to use the " @app-name " services?")
  759.         (help "    The fingerd service daemon is moved to directory "
  760.           "\"AmiTCP:serv\", and \"inetd.conf\" must be updated to use "
  761.           "it. Also the NetFS must be added to old configuration")))))
  762.  ;;
  763.  (procedure 
  764.   update-napsaprefs
  765.   (set old-napsaprefs
  766.        (if (exists (tackon old-atcp-directory "db/NapsaPrefs") (noreq))
  767.        (tackon old-atcp-directory "db/NapsaPrefs")
  768.      (if (exists "s:NapsaPrefs")
  769.          "s:NapsaPrefs")
  770.      ""))
  771.   (if old-napsaprefs
  772.       (;;
  773.        (copyfiles 
  774.     (source old-napsaprefs)
  775.     (dest conf-dir)
  776.     (files)
  777.     (confirm)
  778.     (prompt "\nUse your old Napsaterm preferences?")
  779.     (help  "    Installer have found an existing NapsaPrefs file "
  780.            old-napsaprefs ". You can copy it to new configuration "
  781.            "directory.")))))
  782.  (procedure 
  783.   copy-extra-binaries
  784.   "")
  785.  (transcript "Ready to copy old configuration.")
  786.  (if (askbool
  787.       (default 1)
  788.       (prompt
  789.        "\nDo you want to use settings from an earlier installation?")
  790.       (help
  791.        "    Installer have detected existing configuration "
  792.        "directory \"" old-conf-dir "\" which "
  793.        "can be used to configure the " app-name ". You can keep most "
  794.        "of your previous configuration. This is important if you have "
  795.        "installed extra applications.\n"
  796.        (if (< old-atcp-version 4)
  797.        (cat "    However, since the configuration practice of the "
  798.         @app-name " has changed since your old version, you must "
  799.         "reconfigure the " @app-name " itself. Sorry for the "
  800.         "incovenience.\n")
  801.      (cat "    Installer will copy your \"" old-startnet "\" script and "
  802.           "\"" old-resolv.conf "\" configuration.\n"))
  803.        "    Other configuration files will be then "
  804.        (if (> @user-level 1) 
  805.        "optionally")
  806.        " copied.\n"))
  807.      ((set no-reconfig (if (>= old-atcp-version 4)
  808.                (copy-old-startnet)))
  809.       (copy-rest-config)
  810.       (copy-motd)
  811.       (update-inetd-conf)
  812.       (update-hosts)
  813.       (update-services)
  814. ;;      (update-startnet)
  815.       (update-napsaprefs)
  816.       (copy-extra-binaries)
  817.       no-reconfig) ;; FALSE if AmiTCP needs to be reconfigured
  818.    0))
  819.  
  820. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  821. (procedure
  822.  install-emacstcp
  823.  ;; is GNU Emacs installed?
  824.  (if (exists "GNUEmacs:" (noreq)) ; check if GNUEmacs is installed
  825.  
  826.      ((set 
  827.        unpkt-source GNUEmacs-pkt-file
  828.        unpkt-destination "GNUEmacs:/"
  829.        unpkt-sdp 1
  830.        unpkt-title-name "GNU Emacs support"
  831.        unpkt-title-not "GNU Emacs support"
  832.        )
  833.       (if (run-unpkt)
  834.       ;; Tell user what to do with .emacs
  835.       (run (cat "run " pager-cmd)
  836.            GNUEmacs-readme-file
  837.            (safe))
  838.     )
  839.       )
  840.    (message "GNU Emacs must be installed before....")))
  841.  
  842. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  843. (procedure
  844.  install-napsaterm
  845.  ;;
  846.  ;; Install Napsaterm fonts
  847.  ;;
  848.  ;; Ask for directory to install fonts.
  849.  (procedure
  850.   ask-napsa-font-dir
  851.   (askdir
  852.    (prompt "Select directory where to install Napsaterm fonts.\n")
  853.    (help "    Here you can specify location where to install "
  854.      "the Napsaterm font called `napsa'. "
  855.      "This directory should be in your font path "
  856.      "(i.e. some directory in the assign fonts:).")
  857.    (newpath)
  858.    (default "fonts:")))
  859.  
  860.  (set 
  861.   unpkt-source NapsaFonts-pkt-file
  862.   unpkt-destination (cat (ask-napsa-font-dir) "/")
  863.   unpkt-sdp 1
  864.   unpkt-title-name "NapsaTerm fonts"
  865.   unpkt-title-not "NapsaTerm special fonts"
  866.   )
  867.  (run-unpkt)
  868.  )
  869.  
  870. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  871. (procedure
  872.  ;;
  873.  ;; Check if user exists in the user database
  874.  ;;
  875.  ;; takes the user name in ::user-name
  876.  ;;
  877.  does-user-exist
  878.  (if (run (cat "search " (tackon conf-dir "passwd") " \"" ::user-name "|\" NONUM ")
  879.       (safe))
  880.      0
  881.    1)
  882.  )
  883.  
  884. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  885. (procedure 
  886.  ;;
  887.  ;; Add a new user into AmiTCP:db/passwd
  888.  ;;
  889.  add-new-user
  890.  (if (= anu::setdefaults 0)
  891.      (set   
  892.       anu::passwd (tackon conf-dir "passwd")
  893.       anu::passwd-new (cat anu::passwd ".new")
  894.       anu::passwd-old (cat anu::passwd ".old")
  895.       anu::tempfile "t:run-the-password"
  896.       anu::helptext (cat "    You must give an login name, user ID, group ID "
  897.              "real name and home directory for each user.\n")
  898.       anu::setdefaults 1
  899.       anu::username (cat default-user-name)
  900.       anu::UID 100
  901.       anu::GID 100
  902.       anu::realname ""
  903.       anu::homedir "HOME:"
  904.       anu::shell "shell"))
  905.  (while
  906.      ((set anu::username
  907.        (askstring
  908.         (default anu::username)
  909.         (prompt "Enter the login name of the new user:\n")
  910.         (help anu::helptext
  911.           "    The login name consists of lowercase letters a-z "
  912.           "and numbers.  Its recommended maximum length is 8 "
  913.           "characters.\n"
  914.           "    Examples of acceptable login names are `ppessi' "
  915.           "and `an345'.")))
  916.       (set ::user-name anu::username)
  917.       (if (does-user-exist)
  918.       ((message "User " anu::username " already exists.")
  919.        1))))
  920.  (set anu::UID
  921.       (asknumber
  922.        (default anu::UID)
  923.        (prompt (cat "Enter the user ID of the user " anu::username ":\n"))
  924.        (help anu::helptext
  925.          "    The user ID is a numeric unique identifier for each "
  926.          "user. "
  927.          "It is a number between 100 - 32767 for ordinary users.\n")))
  928.  (set anu::GID
  929.       (asknumber
  930.        (default anu::GID)
  931.        (prompt (cat "Enter the primary group ID of the user " 
  932.             anu::username ":\n"))
  933.        (help anu::helptext
  934.          "    The group ID is a numeric identifier of groups. "
  935.          "Each user has a primary group, which is usually 100, "
  936.          "group \"users\".\n")))
  937.  (set anu::realname
  938.       (askstring
  939.        (default anu::realname)
  940.        (prompt (cat "Enter the real name of the user " anu::username ":\n"))
  941.        (help anu::helptext
  942.          "    The real name can contain any characters except "
  943.          "comma (`,'), colon (`:') or bar (`|').")))
  944.  (set anu::homedir
  945.       (askdir
  946.        (default anu::homedir)
  947.        (prompt (cat "Give the home directory of the user " anu::username ":\n"))
  948.        (help anu::helptext
  949.          "    When user logs in, the current directory is changed to"
  950.          "her home directory.  Also, the finger information (.plan"
  951.          "and .project) is retrieved from home directory.")
  952.        (newpath)))
  953.  (set anu::shell
  954.       (askstring
  955.        (default anu::shell)
  956.        (prompt (cat "Enter the name of command interpreter for the user "
  957.             anu::username ":\n"))
  958.        (help anu::helptext
  959.          "    The command interpreter value can be either "
  960.          "`shell' or `cli'.")))
  961.  (set anu::passwd-entry 
  962.       (cat anu::username "||" anu::UID "|" anu::GID "|" 
  963.        anu::realname "|" anu::homedir "|" anu::shell "\n"))
  964.  (if (askbool 
  965.       (prompt (cat "Are you sure you want to add following user:\n\n"
  966.            "Login name: " anu::username "\n"
  967.            "User ID: " anu::UID "\n"
  968.            "Group ID: " anu::GID "\n"
  969.            "Real name: " anu::realname "\n"
  970.            "Home directory: " anu::homedir "\n"
  971.            "Shell: " anu::shell "\n"))
  972.       (choices (cat "Add " anu::username) (cat "Skip " anu::username))
  973.       (help "You can still skip creating the new user."))
  974.      ((textfile (dest anu::passwd-new)
  975.         (include anu::passwd)
  976.         (append anu::passwd-entry))
  977.       (copyfiles (source anu::passwd)
  978.          (dest conf-dir)
  979.          (newname "passwd.old")
  980.          (optional "askuser"))
  981.       (copyfiles (source anu::passwd-new)
  982.          (dest conf-dir)
  983.          (newname "passwd")
  984.          (optional "askuser"))
  985.       (textfile (dest anu::tempfile)
  986.         (append (cat 
  987.              "failat 5000\n"
  988.              "avail flush >nil:\n"
  989.              (tackon bin-dir "login") " " anu::username "\n"
  990.              (tackon bin-dir "passwd") " " anu::username "\n"
  991.              "endshell\n"))
  992.         (safe))
  993.       (run (cat "newshell from " anu::tempfile))
  994.       (set anu::username ""
  995.        anu::UID (+ anu::UID 1)
  996.        anu::realname "")
  997.       1))
  998.  )
  999.  
  1000. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1001. (procedure
  1002.  ;;
  1003.  ;; Add a new users into AmiTCP:db/passwd
  1004.  ;;
  1005.  add-new-users
  1006.  (while
  1007.      (askbool (prompt "\nDo you want to create a new user account?\n"
  1008.               "\nYou will be logged in with the new account "
  1009.               "immediately to set the password.")
  1010.           (choices "Proceed" "Cancel")
  1011.           (help "    You are about to add a new users into user database. "
  1012.             "Remember that the user id of each user must be unique! "
  1013.             "You will be logged in with the new user account to "
  1014.             "set the password for the new user.\n"))
  1015.    (add-new-user))
  1016.  )
  1017. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1018. (procedure 
  1019.  ;;
  1020.  ;; Ask for the default user
  1021.  ;;
  1022.  ask-default-user
  1023.  (if (= adu::setdefaults 0)
  1024.      (set   
  1025.       adu::setdefaults 1
  1026.       default-user-name ""))
  1027.  (while (= default-user-name "")
  1028.    (while
  1029.        ((set default-user-name
  1030.          (askstring
  1031.           (default default-user-name)
  1032.           (prompt "Enter the default user name\n")
  1033.           (help "    The AmiTCP/IP can handle currently only one user "
  1034.             "at a time.  The default user is selected with `login' "
  1035.             "command by system startup script. ")))
  1036.     (set ::user-name default-user-name)
  1037.     (if (NOT (does-user-exist))
  1038.       (NOT (add-new-user))))))
  1039.  )
  1040.  
  1041. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1042. (procedure
  1043.  ;;
  1044.  ;; Install passwd and group databases
  1045.  ;;
  1046.  install-user-databases
  1047.  (transcript "Installing user databases")
  1048.  (procedure get-mufs-version
  1049.         (set mufs-vernum (getversion "multiuser.library" (resident)))
  1050.         (set mufs-ver (/ mufs-vernum 65536))
  1051.         (set mufs-rev (- mufs-vernum (* ver 65536))))
  1052.  (procedure passwd-create
  1053.         (copyfiles
  1054.          (prompt "Copying " passwd-source " to AmiTCP:db/passwd.")
  1055.          (source passwd-source)
  1056.          (dest conf-dir)
  1057.          (newname "passwd")
  1058.          (optional "nofail")))
  1059.  (procedure group-create
  1060.         (copyfiles
  1061.          (prompt "Copying " group-source " to AmiTCP:db/group.")
  1062.          (source group-source)
  1063.          (dest conf-dir)
  1064.          (newname "group")
  1065.          (optional "nofail")))
  1066.        
  1067.  (set passwd-source (tackon conf-dir "passwd-example"))
  1068.  (set group-source (tackon conf-dir "group-example"))
  1069.  (if (>= @user-level 2)
  1070.      (message 
  1071.       "\n"
  1072.       "Copying user database from file"
  1073.       "\n\n\"" passwd-source "\"\n\n"
  1074.       "and group database from file"
  1075.       "\n\n\"" group-source "\"\n\n"))
  1076.  (passwd-create)
  1077.  (group-create)
  1078.  )
  1079.  
  1080. (procedure 
  1081.  set-must-reboot
  1082.  (if (<> (getversion "netinfo.device" (resident)) 0)
  1083.      ((set netinfo-temp-file "t:netinfo-expunge-script")
  1084.       (textfile (dest netinfo-temp-file)
  1085.         (append (cat 
  1086.              "failat 5000\n"
  1087.              "avail flush >nil:\n"
  1088.              "avail flush >nil:\n"))
  1089.         (safe))
  1090.       (execute netinfo-temp-file)))
  1091.  (if (<> (getversion "netinfo.device" (resident)) 0)
  1092.      ((set must-reboot-after-install 1)
  1093.       (message "You seem to have some parts of an old " @app-name 
  1094.            " installation running.  Because of this the user "
  1095.            "database updating will have no effect before you reboot "
  1096.            "your Amiga.\n\n"
  1097.            "For this reason you _must_ reboot after the installation "
  1098.            "and before the \"Config_AmiTCP\" is run."))))
  1099.  
  1100. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1101. ;;;
  1102. ;;; Ask which parts to install
  1103. ;;;
  1104. ;;; on return following variables will have boolean values:
  1105. ;;;
  1106. ;;;  do-install-amitcp
  1107. ;;;  do-install-drivers
  1108. ;;;  do-install-emacstcp
  1109. ;;;  do-install-napsafonts
  1110. ;;;
  1111. (procedure
  1112.  ask-install-options
  1113.  (set 
  1114.   install-options-bitmap
  1115.   (askoptions
  1116.    (prompt "Select parts to install:\n\n"
  1117.        "See the help for explanation on each item.")
  1118.    (choices "AmiTCP/IP"
  1119.         "Updated Sana-II network drivers"
  1120.         "GNU Emacs support"
  1121.         "NapsaTerm fonts"
  1122.         "AmiTCP/IP Software Development Kit"
  1123.         )
  1124.    (default (if (exists "GNUEmacs:" (noreq))
  1125.         %00111
  1126.           %00011))
  1127.    (help "    AmiTCP/IP: "
  1128.      "The AmiTCP/IP itself. This includes binaries, help files and "
  1129.      "example configuration files.\n"
  1130.      "    Updated Sana-II network drivers: "
  1131.      "If this option is checked, the Sana-II drivers in Devs:Networks "
  1132.      "will be updated. You will be asked for confirmation for each driver.\n"
  1133.      "    GNU Emacs support: "
  1134.      "AmiTCP/IP provides an Emacs extension, which makes "
  1135.      "it possible to run networking programs with it. To enable "
  1136.      "this feature some files need to be installed "
  1137.      "in to directories under \"GNUEmacs:\". "
  1138.      "NOTE: This option has effect only if GNU Emacs is currently installed.\n"
  1139.      "    NapsaTerm fonts: "
  1140.      "NapsaTerm has special fonts, that are sized 6×11 pixels and contain "
  1141.      "some special VT102 characters. They are suitable for interlaced "
  1142.      "screens. If you have normal NTSC or PAL screen, it might be better "
  1143.      "to not install these fonts but use Topaz/8 instead.\n"
  1144.      "    AmiTCP/IP Software Development Kit (SDK): "
  1145.      "AmiTCP/IP programmer's include files and libraries. This is offered "
  1146.      "as a free bonus in this release. The SDK currently supports only "
  1147.      "SAS/C, but many if it's files can be used with other compilers as "
  1148.      "well.\n"
  1149.      ))
  1150.   do-install-amitcp (in install-options-bitmap 0)
  1151.   do-install-drivers (in install-options-bitmap 1)
  1152.   do-install-emacstcp (in install-options-bitmap 2)
  1153.   do-install-napsafonts (in install-options-bitmap 3)
  1154.   do-install-sdk (in install-options-bitmap 4)
  1155.   ))
  1156.  
  1157.  
  1158. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1159. ;;;
  1160. ;;; Install AmiTCP/IP
  1161. ;;;
  1162. (procedure 
  1163.  install-amitcp
  1164.  (select-destination-directory)
  1165.  (if (copy-files-to-destination) ; copy AmiTCP/IP files
  1166.      (
  1167.       ;; update user-startup
  1168.       (set uus::commands (cat "assign " atcp-assign " " @default-dest "\n"
  1169.                   "path " bin-dir " add\n"
  1170.                   apipe-mount)
  1171.        uus::section @app-name
  1172.        uus::file (tackon atcp-assign "addition-to-user-startup"))
  1173.       (update-user-startup))
  1174.    ))
  1175.  
  1176. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1177. (procedure
  1178.  install-sdk
  1179.  (set sdk-dest-dir
  1180.       (askdir
  1181.        (prompt "Select the directory in which the SDK should be placed:")
  1182.        (help "    The SDK subdirectories will be placed on the directory you "
  1183.          "select.\n")            
  1184.        (newpath)
  1185.        (default @default-dest)))
  1186.  (if (NOT (= 2 (exists (sdk-dest-dir))))
  1187.      (makedir sdk-dest-dir (infos)))
  1188.  
  1189.  ((set 
  1190.    unpkt-source SDK-pkt-file
  1191.    unpkt-destination (cat sdk-dest-dir "//")
  1192.    unpkt-sdp 1
  1193.    unpkt-title-name "Software Development Kit"
  1194.    unpkt-title-not "The SDK"
  1195.    )
  1196.   (if (run-unpkt)
  1197.       (
  1198.        ;; add assigns to user-startup
  1199.        (set uus::commands
  1200.         (cat "assign netinclude: " (tackon sdk-dest-dir "netinclude") "\n"
  1201.          "assign netlib: " (tackon sdk-dest-dir "netlib") "\n"
  1202.          (if (<> (expandpath atcp-assign)
  1203.              (expandpath sdk-dest-dir))
  1204.              (cat "path " (tackon sdk-dest-dir "bin") " add\n")
  1205.            ""))
  1206.         uus::section (cat @app-name " SDK")
  1207.         uus::file (tackon atcp-assign "addition-to-user-startup-SDK"))
  1208.        (update-user-startup)
  1209.        ;; Show the SDK readme file
  1210.        (run (cat "run " pager-cmd) SDK-readme-file (safe)))
  1211.     )))
  1212.  
  1213. ;;; copy "UnPkt" to RAM: if available
  1214. ;;
  1215. ;; If UnPkt is not found, then we are not started from the installation disk
  1216. ;;
  1217. ;;;
  1218. (procedure
  1219.  set-unpkt-cmd
  1220.  (set unpkt-cmd
  1221.       (if (exists UnPkt-file)
  1222.       ((copyfiles
  1223.         (prompt "Copying packet dearchiver to RAM:")
  1224.         (source UnPkt-file)
  1225.         (dest   "RAM:")
  1226.         (safe)
  1227.         (optional "nofail"))
  1228.        "RAM:UnLZX -a x")
  1229.     "")))
  1230.  
  1231. ;;;;;
  1232. ;
  1233. ; Launch Config_AmiTCP
  1234. ;
  1235. (procedure
  1236.   run-config-amitcp
  1237.   (set start-config-script "t:start-config-script")
  1238.   (textfile 
  1239.    (dest start-config-script)
  1240.    (append
  1241.     ".key foo\n.bra {\n.ket }\n\n"
  1242.     "cd " atcp-assign "\n"
  1243.     "Stack 20000 ; Installer needs this\n"
  1244.     (tackon bin-dir "Installer")
  1245.     " SCRIPT \"Config AmiTCP\" APPNAME AmiTCP/IP MINUSER AVERAGE\n"
  1246.     )
  1247.    (safe))
  1248.   (protect start-config-script "+s +e")
  1249.   (if (askbool
  1250.        (prompt "\nStart \"Config AmiTCP\" to configure the just "
  1251.            "installed " @app-name "?")
  1252.        (help @app-name " should be configured after the installation. "
  1253.          "If you do not want to do the configuration now, you must "
  1254.          "do it later by starting the \"Config AmiTCP\" from the "
  1255.          "WorkBench icon.\n"))
  1256.       (execute start-config-script)))
  1257.  
  1258. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1259. ;;;
  1260. ;;; Installatation sequence
  1261. ;;;
  1262.  
  1263. ;
  1264. ; Initialize "global" variables to default values (not complete)
  1265. ;
  1266. (set
  1267.  startup-changed 0
  1268.  must-reboot-after-install 0
  1269.  )
  1270.  
  1271. (complete 00) (transcript "On making " app-name ".")
  1272. (complete 01) (check-user-level)
  1273. (complete 02) (check-system-version)
  1274. (complete 03) (check-available-memory)
  1275. (complete 04) (check-old-assign)
  1276. (complete 05) (check-cpu-type)
  1277.  
  1278. ; askdisk for the install-disk1-name?? maybe later...
  1279.  
  1280.  
  1281. ;
  1282. ; Check if started from the installation disk
  1283. ;
  1284. ;(if (= (expandpath source-dir) install-disk1-name)
  1285. ;    (
  1286.      (set-unpkt-cmd)
  1287.      (if (= unpkt-cmd "")
  1288.      (abort "    UnLZX command not present on the installation disk!"))
  1289.  
  1290.      (complete 08) (ask-accept-license)      ; ask if user accepts the license
  1291.      (complete 10) (ask-install-options)
  1292.      (complete 15) (if do-install-amitcp (install-amitcp))
  1293.      (complete 30) (if do-install-sdk (install-sdk))
  1294.      (complete 25) (if do-install-emacstcp (install-emacstcp))
  1295.      (complete 30) (if do-install-napsafonts (install-napsaterm))
  1296.      (complete 35) (if do-install-drivers (update-devices))
  1297.      (if do-install-amitcp      ; Ask if old configuration should be copied
  1298.      (
  1299.       (set-must-reboot)
  1300.       (set old-conf-used 
  1301.            (if old-atcp-directory
  1302.            (if (exists (tackon old-atcp-directory "bin/startnet") 
  1303.                    (noreq))
  1304.                ((complete 40)
  1305.             (ask-copy-old-configuration)))))
  1306.       ;;
  1307.       ;; Install user databases if not copied from an old configuration
  1308.       ;;
  1309.       (if (exists (tackon conf-dir "passwd"))
  1310.           (transcript "There is already a user database.")
  1311.         ((complete 70)
  1312.          (install-user-databases))) ; install passwd/group
  1313.       ;;
  1314.       ;; Configure AmiTCP/IP is necessary
  1315.       ;;
  1316.       (complete 90)
  1317.       (if (AND (NOT must-reboot-after-install) (NOT old-conf-used))
  1318.           ;;
  1319.           ;; Spawn the installer on the Config_AmiTCP with 
  1320.           ;; correct options
  1321.           (run-config-amitcp)
  1322.           ;(configure-amitcp)
  1323.         )
  1324.       ))
  1325.      ;; show something
  1326.      (foreach atcp-assign "#?.readme"
  1327.           (run (cat "run " pager-cmd) (tackon atcp-assign @each-name)
  1328.            (safe)))
  1329. ;     )
  1330. ;  (    ;; Not started from the installation directory
  1331. ;   ;; Started from an unknown directory
  1332. ;   (abort "    The installation was started from an invalid directory.\n"
  1333. ;         "    If you want to re-install some parts of the " @app-name
  1334. ;         " installation, "
  1335. ;         "please start the \"Install_AmiTCP\" from the installation disk.")
  1336. ;   )
  1337. ;  )
  1338.  
  1339. ;;; All done!
  1340. (complete 100)
  1341. (exit (if startup-changed 
  1342.       (cat "You should reboot your Amiga to enable the changes made "
  1343.            "to system startup files.")
  1344.     (cat "You must add the contents of the file(s) \"" 
  1345.          "addition-to-user-startup#?\" to your S:User-Startup and "
  1346.          "reboot before you can use " @app-name ".\n"
  1347.          "\n"
  1348.          "...and now enjoy another high-quality dECiSiON-Release!\n"))
  1349.       (if must-reboot-after-install
  1350.       (cat "\nYou MUST reboot before configuring " @app-name ". Start "
  1351.            "\"Config_AmiTCP\" from WorkBench after the reboot "
  1352.            "to configure your new " @app-name " installation.\n"
  1353.            "\n"
  1354.            "...and now enjoy another high-quality dECiSiON-Release!\n")))
  1355.  
  1356. ; EOF
  1357.